package Person.XianCheng;
class MyThread02 implements Runnable{


private int ticket=5;
    @Override
    public void run() {
        for(int i=0;i<100;i++){
            if(this.ticket>0){
            System.out.println("买票，ticket="+this.ticket--);
        }}
    }
}
public class ThreadDemo02 {
    public static void main(String[] args) {
        MyThread02 mt = new MyThread02();
        new Thread(mt).start();
        new Thread(mt).start();
        new Thread(mt).start();
    }
}
